import QtQuick
import QtQuick.Layouts

import Fk
import Fk.Components.LunarLTK

ColumnLayout {
  id: root
  anchors.fill: parent
  property var extra_data: ({ name: "", data: "" })
  signal finish()

  BigGlowText {
    Layout.fillWidth: true
    Layout.preferredHeight: childrenRect.height + 4

    text: Lua.tr(extra_data.name)
  }

  RowLayout {
    spacing: 15
    width: parent.width
    Layout.fillWidth: true
    Layout.fillHeight: true

    Image { // 背景
      id: backgroundPic
      fillMode: Image.PreserveAspectCrop
      source: AppPath + "/packages/MahjongSoul/image/misc/sz_wuxing.png"
      Layout.preferredWidth: 420
      Layout.preferredHeight: 400
    }

    Flickable {
      id: detail
      Layout.fillWidth: true
      Layout.fillHeight: true
      clip: true
      contentHeight: contentColumn.height // 设置内容高度为列的高度

      // 当前元素效果
      Column {
        id: contentColumn
        width: parent.width
        spacing: 10

        Image {
          fillMode: Image.PreserveAspectCrop
          source: AppPath + "/packages/MahjongSoul/image/misc/" + extra_data.data + ".png"
        }

        Text {
          width: parent.width
          text: "<b>" + Lua.tr("sz_card_effect") + "</b>"
          color: "white"
          wrapMode: Text.WordWrap
          font.pixelSize: 18
          textFormat: Text.RichText
        }

        Text {
          width: parent.width
          text: Lua.tr("card:" + extra_data.data)
          color: "#E4D5A0"
          wrapMode: Text.WordWrap
          font.pixelSize: 16
          textFormat: Text.RichText
        }

        Text {
          width: parent.width
          text: "<b>" + Lua.tr("sz_player_effect") + "</b>"
          color: "white"
          wrapMode: Text.WordWrap
          font.pixelSize: 18
          textFormat: Text.RichText
        }

        Text {
          width: parent.width
          text: Lua.tr("player:" + extra_data.data)
          color: "#E4D5A0"
          wrapMode: Text.WordWrap
          font.pixelSize: 16
          textFormat: Text.RichText
        }
      }
    }

  }

}

